<template>
  <div>
    <el-form ref="form" :inline="true" size="small" label-width="60px">
      <el-form-item label="UUID">
        <el-input style="width: 400px" v-model="uuid"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button @click="searchBtnClick">查询</el-button>
      </el-form-item>
      <br /><br />
      <p>{{ dataStr }}</p>
    </el-form>
  </div>
</template>

<script lang="ts">
  import { Vue, Component } from 'vue-property-decorator'
  import { get } from '@/api/ajax'
  import { GetDataApi } from '@/api/apis'
  import YBPopView from "@/utils/popView";

  @Component({
    components: {}
  })

  export default class Home extends Vue{

    uuid = 'dba3ff8d-1a9a-4825-994e-5af9ce01185f'
    dataStr = ''

    searchBtnClick() {
      if (!this.uuid) {
        YBPopView.msgError('请输入UUID')
        return
      }
      get<string>(`${GetDataApi.getOneData}/${this.uuid}`).then((data) => {
        this.dataStr = data
      })
    }
  }
</script>

<style scoped>

</style>
